<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.wwdx.shiro.SessionUser" %>
<%@ include file="/public/inc/tags.jsp"%>
<html>
<head>
    <jsp:include page="/public/inc/head.jsp"/>
</head>
<body>
<div id="header" class="navbar navbar-static-top" role="navigation">
    <jsp:include page="/public/inc/top.jsp"/>
</div>
<div class="container-fluid" style="margin-top:5px;margin-bottom:60px;">
    <div class="row">
        <jsp:include page="/public/inc/menu.jsp"/>
        <div class="col-xs-12 col-sm-10">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <div class="media">
                        <div class="media-body">
                            <span class="glyphicon glyphicon-list"></span> 订单管理
                        </div>
                        <div class="media-right">

                        </div>
                    </div>
                </div>
                <div class="panel-body">
                    <div class="form-inline">
                        <form action="/system/wwdx_order/list" method="post">
                            <label>
                                <select name="status" class="form-control">
                                    <option value="">支付类型</option>
                                    <option value="1" <c:if test="${model.status==1}"> selected="selected"</c:if>>已支付
                                    </option>
                                    <option value="0" <c:if test="${model.status==0}"> selected="selected"</c:if>>未支付
                                    </option>
                                </select>
                            </label>
                            <label>
                                <select name="type" class="form-control">
                                    <option value="">产品类型</option>
                                    <option value="1" <c:if test="${model.type==1}"> selected="selected"</c:if>>阅读包</option>
                                    <option value="2" <c:if test="${model.type==2}"> selected="selected"</c:if>>解读版</option>
                                    <option value="3" <c:if test="${model.type==3}"> selected="selected"</c:if>>阅读币</option>
                                    <option value="7" <c:if test="${model.type==7}"> selected="selected"</c:if>>会员</option>
                                </select>
                            </label>
                            <div class="form-group">
                                <div class="col-md-offset-3 col-md-10">
                                    <button type="submit" class="btn btn-default">筛选</button>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-offset-3 col-md-10">
                                    <button type="reset" class="btn btn-default">清空</button>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-offset-3 col-md-10">
                                    <a href="/system/wwdx_order/export?email=<%=SessionUser.getEmail()%>" class="btn btn-primary">导出Excel</a>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-condensed table-striped table-bordered table-hover">
                        <thead>
                        <tr style="background: silver;">
                            <th>编码</th>
                            <th>类型</th>
                            <th>价格</th>
                            <th>产品名称</th>
                            <th>用户名称</th>
                            <th>渠道</th>
                            <th>支付时间</th>
                            <th>是否支付</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="l" items="${list}" varStatus="status">
                            <tr>
                                <td> ${status.index + 1}</td>
                                <td>
                                    <c:choose>
                                        <c:when test="${l.type==1}">
                                            阅读包
                                        </c:when>
                                        <c:when test="${l.type==2}">
                                            解读版
                                        </c:when>
                                        <c:when test="${l.type==3}">
                                            虚拟币
                                        </c:when>
                                        <c:when test="${l.type==7}">
                                            会员
                                        </c:when>
                                        <c:otherwise>
                                            其他
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                                <td>${l.price}</td>
                                <td>${l.product_name}</td>
                                <td>${l.member_name}</td>
                                <td>
                                    <c:choose>
                                        <c:when test="${l.channel eq 'weixin'}">
                                            微信公众号
                                        </c:when>
                                        <c:when test="${l.channel eq 'android'}">
                                            安卓APP
                                        </c:when>
                                        <c:when test="${l.channel eq 'wxma'}">
                                            微信小程序
                                        </c:when>
                                        <c:when test="${l.channel eq 'ios'}">
                                            苹果APP
                                        </c:when>
                                    </c:choose>
                                </td>
                                <td>
                                    <fmt:formatDate value="${l.create_time}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                </td>
                                <td>
                                    <c:choose>
                                        <c:when test="${l.status!=1}">
                                            <span class="label label-default">未支付</span>
                                        </c:when>
                                        <c:otherwise>
                                            <span class="label label-primary">已支付</span>
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
                <div class="panel-footer">
                    <p:pagination url="/system/wwdx_order/list" total="${listSize}"/>
                </div>
            </div>
        </div>
    </div>
</div>
<jsp:include page="/public/inc/bottom.jsp"/>
</body>
</html>
